#ifndef STUDENTWIDGET_H
#define STUDENTWIDGET_H

#include <QWidget>
#include <QDialog>
#include "student.h"
#include "file.h"
#include "modelset.h"

namespace Ui {
class StudentWidget;
}

class StudentWidget : public QWidget
{
    Q_OBJECT

public:
    explicit StudentWidget(QWidget *parent = nullptr);
    ~StudentWidget();
    //获取登陆时的Id以检索相关信息
    void getLoginId(QString loginId);
    //通过读取文件信息，设置学生对象
    void setStuObject();
    //通过读取文件信息，设置学生成绩
    void setStuScore();

private slots:
    void on_btn_exit_clicked();

    void on_btn_check_myinfo_clicked();

    void on_btn_check_score_clicked();

    void on_btn_display_all_clicked();

    void on_btn_giveup_course_clicked();

    void on_btn_modify_password_clicked();

    void on_btn_confirm_clicked();

    void on_btn_select_course_clicked();

    void on_btn_display_course_clicked();

    void on_btn_quit_clicked();

    void sortView(int a);

private:
    Ui::StudentWidget *ui;
    student *stuInfo1;
    student *stuInfo2;
    file *file1;
    modelSet *setM;
    QString loginId;
    QStandardItemModel *model;
    bool flag=0;
};

#endif // STUDENTWIDGET_H


